package edu.towson.greenteam.command;

import edu.towson.greenteam.InformationAggregator;
import edu.towson.greenteam.offer.Offer;

public class CMDAddOffer implements Command {
	
	InformationAggregator ia;
	String name;
	String description;
	int percentDiscount;
	float minTabValue;
	
	public CMDAddOffer(InformationAggregator ia, String name, String description,
			int percentDiscount, float minTabValue) {
		this.ia = ia;
		this.name = name;
		this.description = description;
		this.percentDiscount = percentDiscount;
		this.minTabValue = minTabValue;
	}

	@Override
	public Object execute() {
		return (ia.getOffers().add(new Offer(name, description, percentDiscount, minTabValue)));
	}

}